package com.zsl.swing.redis.desktop.window.builder;

import com.zsl.swing.redis.desktop.type.BtnOptEnum;

import javax.swing.*;
import java.awt.event.ActionListener;

public class ConfirmCancelBtnPanelBuilder {

    private ConfirmCancelBtnPanelBuilder(){}

    public static JPanel getInstance(ActionListener actionListener){
        JButton o = new JButton(BtnOptEnum.CONFIRM.getText());
        JButton n = new JButton(BtnOptEnum.CANCEL.getText());

        o.addActionListener(actionListener);
        n.addActionListener(actionListener);

        JPanel panel = new JPanel();
        panel.add(o);
        panel.add(n);
        return panel;

    }
}
